{% load highlight %}
{% load comments %}

<article class="blog-entry" id="blog-entry-{{ entry.id }}">

  {% if entry.type == 'p' %}
    <h3 class="blog-entry-title">
      <a class="" href="{% url 'blog:detail' entry.id %}">{% highlight entry.title with query %}</a>
    </h3>
  {% elif entry.type == 'm' %}
    <h3 class="blog-entry-title">
      <a class=""
         href="{% url 'courses:material_detail' entry.course.slug entry.id %}">{% highlight entry.title with query %}</a>
    </h3>
  {% endif %}
  <div class="blog-entry-meta">
    <time class="text-muted text-small meta-item" title="{{ entry.pub_date|date }}"><i
            class="ri-time-line"></i> {{ entry.pub_date|date:"Y-m-d" }}</time>
    {% get_comment_count for entry as comment_count %}
    <a class="text-muted text-small meta-item" href="{% url 'blog:detail' entry.id %}"><i
            class="ri-chat-2-line"></i> {{ comment_count }}</a>
    <a class="text-muted text-small meta-item" href="{% url 'blog:detail' entry.id %}"><i
            class="ri-eye-line"></i> {{ entry.views }}</a>
    {% if entry.type == 'm' %}
      <a href="{% url 'courses:course_detail' entry.course.slug %}" class="meta-item blog-badge">系列教程</a>
    {% endif %}
  </div>
  <p class="blog-entry-brief">{% highlight result.object.body with query %}</p>
</article>